
#pragma once


namespace __OCF_STUB__ 
{


using namespace __OCF_BASE__;

template <class IF>
class CUserToGw
{
	typedef TYPE_LIST07(BYTE,BYTE*,USHORT,char,char*,int,int*) _OCF_PROXYSTUB_TYPELIST_T;
	enum __ENUM_PROXYSTUB_FUNCTION_TYPE__
	{
		__ENUM_FUNCTION_TYPE_fnCheckAuth__ = 1,

		__END__
	};
	typedef IF _N_IF_T;
	typedef long (CUserToGw<_N_IF_T>::*_FUNC_T)(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn);

public:
	CUserToGw(_N_IF_T* pcIf, ULONG ulLenBuff, const void* pBuff)
		:m_pcIf(pcIf)
		,m_ulLen(ulLenBuff)
		,m_pBuff(pBuff)
	{
		m_ulBindX = 0;
		m_ulIdentity = 0;

		memset(m_apcFunc, 0x00, sizeof(m_apcFunc));

		m_apcFunc[__ENUM_FUNCTION_TYPE_fnCheckAuth__] = &CUserToGw<_N_IF_T>::fnCheckAuth;

	}
	virtual ~CUserToGw()
	{
	}
	CUserToGw& operator =(const CUserToGw& cFrom)
	{
		m_pcIf = cFrom.m_pcIf;
		m_ulLen = cFrom.m_ulLen;
		m_pBuff = cFrom.m_pBuff;
		m_ulBindX = cFrom.m_ulBindX;
		m_ulIdentity = cFrom.m_ulIdentity;

		return *this;
	}
	long StubDispatch()
	{
		CIn<_OCF_PROXYSTUB_TYPELIST_T> cIn(m_ulLen, m_pBuff);
		USHORT uiCmd;

		if (FALSE == cIn.Pop(uiCmd).IsValid())
		{
			return -2;
		}
		if (uiCmd >= __END__)
		{
			return -3;
		}
		if (NULL == m_apcFunc[uiCmd])
		{
			return -4;
		}
		return (this->*m_apcFunc[uiCmd])(cIn);
	}

private:
	inline ULONG GetBindX() { return m_ulBindX; }
	inline ULONG GetIdentity() { return m_ulIdentity; }

private:
	long fnCheckAuth(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn)
	{
		ULONG nLenTicket;char * pszTicket;
		if (FALSE == cIn.Pop(nLenTicket,(const char ** )(&pszTicket)).IsValid()) return -1;
		return m_pcIf->fnCheckAuth(GetBindX(),GetIdentity(),(int )nLenTicket,pszTicket);
	}

private:
	_FUNC_T m_apcFunc[__END__];
	_N_IF_T* m_pcIf;
	ULONG m_ulLen;
	const void* m_pBuff;
	ULONG m_ulBindX;
	ULONG m_ulIdentity;
};

}
#pragma once


namespace __OCF_STUB__ 
{


using namespace __OCF_BASE__;

template <class IF>
class CGwToLogin
{
	typedef TYPE_LIST07(BYTE,BYTE*,USHORT,char,char*,int,int*) _OCF_PROXYSTUB_TYPELIST_T;
	enum __ENUM_PROXYSTUB_FUNCTION_TYPE__
	{
		__ENUM_FUNCTION_TYPE_fnCheckAuth__ = 10,

		__END__
	};
	typedef IF _N_IF_T;
	typedef long (CGwToLogin<_N_IF_T>::*_FUNC_T)(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn);

public:
	CGwToLogin(_N_IF_T* pcIf, ULONG ulLenBuff, const void* pBuff)
		:m_pcIf(pcIf)
		,m_ulLen(ulLenBuff)
		,m_pBuff(pBuff)
	{
		m_ulBindX = 0;
		m_ulIdentity = 0;

		memset(m_apcFunc, 0x00, sizeof(m_apcFunc));

		m_apcFunc[__ENUM_FUNCTION_TYPE_fnCheckAuth__] = &CGwToLogin<_N_IF_T>::fnCheckAuth;

	}
	virtual ~CGwToLogin()
	{
	}
	CGwToLogin& operator =(const CGwToLogin& cFrom)
	{
		m_pcIf = cFrom.m_pcIf;
		m_ulLen = cFrom.m_ulLen;
		m_pBuff = cFrom.m_pBuff;
		m_ulBindX = cFrom.m_ulBindX;
		m_ulIdentity = cFrom.m_ulIdentity;

		return *this;
	}
	long StubDispatch()
	{
		CIn<_OCF_PROXYSTUB_TYPELIST_T> cIn(m_ulLen, m_pBuff);
		USHORT uiCmd;

		if (FALSE == cIn.Pop(uiCmd).IsValid())
		{
			return -2;
		}
		if (uiCmd >= __END__)
		{
			return -3;
		}
		if (NULL == m_apcFunc[uiCmd])
		{
			return -4;
		}
		return (this->*m_apcFunc[uiCmd])(cIn);
	}

private:
	inline ULONG GetBindX() { return m_ulBindX; }
	inline ULONG GetIdentity() { return m_ulIdentity; }

private:
	long fnCheckAuth(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn)
	{
		ULONG nLenTicket;char * pszTicket;
		if (FALSE == cIn.Pop(nLenTicket,(const char ** )(&pszTicket)).IsValid()) return -1;
		return m_pcIf->fnCheckAuth(GetBindX(),GetIdentity(),(int )nLenTicket,pszTicket);
	}

private:
	_FUNC_T m_apcFunc[__END__];
	_N_IF_T* m_pcIf;
	ULONG m_ulLen;
	const void* m_pBuff;
	ULONG m_ulBindX;
	ULONG m_ulIdentity;
};

}
#pragma once


namespace __OCF_STUB__ 
{


using namespace __OCF_BASE__;

template <class IF>
class CLoginToGw
{
	typedef TYPE_LIST07(BYTE,BYTE*,USHORT,char,char*,int,int*) _OCF_PROXYSTUB_TYPELIST_T;
	enum __ENUM_PROXYSTUB_FUNCTION_TYPE__
	{
		__ENUM_FUNCTION_TYPE_fnResultCheckAuth__ = 20,

		__END__
	};
	typedef IF _N_IF_T;
	typedef long (CLoginToGw<_N_IF_T>::*_FUNC_T)(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn);

public:
	CLoginToGw(_N_IF_T* pcIf, ULONG ulLenBuff, const void* pBuff)
		:m_pcIf(pcIf)
		,m_ulLen(ulLenBuff)
		,m_pBuff(pBuff)
	{
		m_ulBindX = 0;
		m_ulIdentity = 0;

		memset(m_apcFunc, 0x00, sizeof(m_apcFunc));

		m_apcFunc[__ENUM_FUNCTION_TYPE_fnResultCheckAuth__] = &CLoginToGw<_N_IF_T>::fnResultCheckAuth;

	}
	virtual ~CLoginToGw()
	{
	}
	CLoginToGw& operator =(const CLoginToGw& cFrom)
	{
		m_pcIf = cFrom.m_pcIf;
		m_ulLen = cFrom.m_ulLen;
		m_pBuff = cFrom.m_pBuff;
		m_ulBindX = cFrom.m_ulBindX;
		m_ulIdentity = cFrom.m_ulIdentity;

		return *this;
	}
	long StubDispatch()
	{
		CIn<_OCF_PROXYSTUB_TYPELIST_T> cIn(m_ulLen, m_pBuff);
		USHORT uiCmd;

		if (FALSE == cIn.Pop(uiCmd).IsValid())
		{
			return -2;
		}
		if (uiCmd >= __END__)
		{
			return -3;
		}
		if (NULL == m_apcFunc[uiCmd])
		{
			return -4;
		}
		return (this->*m_apcFunc[uiCmd])(cIn);
	}

private:
	inline ULONG GetBindX() { return m_ulBindX; }
	inline ULONG GetIdentity() { return m_ulIdentity; }

private:
	long fnResultCheckAuth(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn)
	{
		BYTE byRes;
		if (FALSE == cIn.Pop(byRes).IsValid()) return -1;
		return m_pcIf->fnResultCheckAuth(GetBindX(),GetIdentity(),byRes);
	}

private:
	_FUNC_T m_apcFunc[__END__];
	_N_IF_T* m_pcIf;
	ULONG m_ulLen;
	const void* m_pBuff;
	ULONG m_ulBindX;
	ULONG m_ulIdentity;
};

}
#pragma once


namespace __OCF_STUB__ 
{


using namespace __OCF_BASE__;

template <class IF>
class CGwToUser
{
	typedef TYPE_LIST07(BYTE,BYTE*,USHORT,char,char*,int,int*) _OCF_PROXYSTUB_TYPELIST_T;
	enum __ENUM_PROXYSTUB_FUNCTION_TYPE__
	{
		__ENUM_FUNCTION_TYPE_fnResultCheckAuth__ = 30,

		__END__
	};
	typedef IF _N_IF_T;
	typedef long (CGwToUser<_N_IF_T>::*_FUNC_T)(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn);

public:
	CGwToUser(_N_IF_T* pcIf, ULONG ulLenBuff, const void* pBuff)
		:m_pcIf(pcIf)
		,m_ulLen(ulLenBuff)
		,m_pBuff(pBuff)
	{
		m_ulBindX = 0;
		m_ulIdentity = 0;

		memset(m_apcFunc, 0x00, sizeof(m_apcFunc));

		m_apcFunc[__ENUM_FUNCTION_TYPE_fnResultCheckAuth__] = &CGwToUser<_N_IF_T>::fnResultCheckAuth;

	}
	virtual ~CGwToUser()
	{
	}
	CGwToUser& operator =(const CGwToUser& cFrom)
	{
		m_pcIf = cFrom.m_pcIf;
		m_ulLen = cFrom.m_ulLen;
		m_pBuff = cFrom.m_pBuff;
		m_ulBindX = cFrom.m_ulBindX;
		m_ulIdentity = cFrom.m_ulIdentity;

		return *this;
	}
	long StubDispatch()
	{
		CIn<_OCF_PROXYSTUB_TYPELIST_T> cIn(m_ulLen, m_pBuff);
		USHORT uiCmd;

		if (FALSE == cIn.Pop(uiCmd).IsValid())
		{
			return -2;
		}
		if (uiCmd >= __END__)
		{
			return -3;
		}
		if (NULL == m_apcFunc[uiCmd])
		{
			return -4;
		}
		return (this->*m_apcFunc[uiCmd])(cIn);
	}

private:
	inline ULONG GetBindX() { return m_ulBindX; }
	inline ULONG GetIdentity() { return m_ulIdentity; }

private:
	long fnResultCheckAuth(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn)
	{
		BYTE byRes;
		if (FALSE == cIn.Pop(byRes).IsValid()) return -1;
		return m_pcIf->fnResultCheckAuth(GetBindX(),GetIdentity(),byRes);
	}

private:
	_FUNC_T m_apcFunc[__END__];
	_N_IF_T* m_pcIf;
	ULONG m_ulLen;
	const void* m_pBuff;
	ULONG m_ulBindX;
	ULONG m_ulIdentity;
};

}